package timing.ukulele.auth.http.wechat;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.service.annotation.GetExchange;
import org.springframework.web.service.annotation.HttpExchange;
import timing.ukulele.auth.model.WxAppSessionResponse;
import timing.ukulele.auth.model.WxWeixinTokenResponse;

/**
 * 微信接口调用
 */
@HttpExchange(url = "/sns")
public interface WeChatExchange {
    /**
     * 调用当前项目的获取验证码方法
     *
     * @return 统一响应类
     */
    @GetExchange("/jscode2session")
    String code2OpenIdByApp(
            @RequestParam("appId") String appId,
            @RequestParam("secret") String secret,
            @RequestParam(value = "grant_type", defaultValue = "authorization_code") String grantType,
            @RequestParam("js_code") String jsCode);


    @GetExchange(value = "/oauth2/access_token")
    String code2OpenIdByWeixin(
            @RequestParam("appId") String appId,
            @RequestParam("secret") String secret,
            @RequestParam(value = "grant_type", defaultValue = "authorization_code") String grantType,
            @RequestParam("code") String code);

}
